<extend name="work/base"/>
<block name="content">
    <blockquote class="layui-elem-quote layui-quote-nm">每天迟到不超过一次正常得天出勤奖金，迟到超过一次得天出勤奖金一半</blockquote>
    <notempty name="user_list">
        <form class="layui-form inline-form">
            <div class="pull-left">
                <div class="layui-inline dropdown">
                    <select name="status" lay-search lay-filter="uid">
                        <option value="">选择人员</option>
                        <volist name="user_list" id="vo" key="k">
                            <option value="{$vo.uid}"> {$vo.nickname}</option>
                        </volist>
                    </select>
                </div>

            </div>
        </form>
    </notempty>
    <table class="layui-table text-center" id="list" lay-filter="list" list-url="{:url('lists')}"
            del-url="{:url('delete')}"  edit-url="{:url('editform')}"
           ></table>
</block>

<block name="script">

    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete"> <i class="fa fa-trash-o"></i> 删除</a>
    </script>
    <script type="text/javascript">
        layui.use(['element', 'table', 'form'], function () {
            var table = layui.table
                , form = layui.form;
            table.render({
                elem: '#list'
                , url: "{:Url('lists')}"
                , page: true
                , loading: true
                ,limit:20
                , cols: [[
                     {field: 'd_time', width: 130, title: '日期'}
                    , {field: 'status',  width: 100,title: '本日状态'}
                    , {field: 'nickname',  width: 100,title: '姓名'}
                    , {field: 'am_in',  width: 100,title: '上午签到'}
                    , {field: 'am_out',  width: 100,title: '上午签退'}
                    , {field: 'fm_in',  width: 100,title: '下午签到'}
                    , {field: 'fm_out',  width: 100,title: '下午签退'}
                    , {field: 'work_wage',  width: 100,title: '奖金',edit:'text',align:'right'}
                    , {field: 'info', title: '说明',edit:'text'}
                    ,{fixed: 'right', width:80,title:'操作', toolbar:'#barDemo'}
                ]]
            });
            form.on('select(uid)', function (data) {
                table.reload('list', {
                    url: "{:Url('lists')}"
                    , page: {
                        curr: 1
                    }
                    , where: {
                        uid: data.value
                    }
                });
                return false;
            });
        });
    </script>
</block>
